package com.dkm.ec.so.repository.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.dkm.base.core.helper.SpringHelper;
import com.dkm.base.db.persistence.dao.IQueryDao;
import com.dkm.biz.repository.AbstractRepository;
import com.dkm.ec.so.domain.SaleReviewImg;
import com.dkm.ec.so.persistence.dao.SaleReviewImgQueryDao;
import com.dkm.ec.so.persistence.entity.SaleReviewImgPo;
import com.dkm.ec.so.repository.SaleReviewImgRepository;

/**
 * 对象功能:评价图片 Repository接口的实现类
 * 开发公司:SKG.COM
 * 开发人员:颜超敏
 * 创建时间:2015-02-10 11:09:39
 */
@Repository
public class SaleReviewImgRepositoryImpl extends AbstractRepository<String, SaleReviewImgPo,SaleReviewImg> implements SaleReviewImgRepository{
	  
	@Resource
	private  SaleReviewImgQueryDao saleReviewImgQueryDao;

	public SaleReviewImg newInstance() {
		SaleReviewImgPo po = new SaleReviewImgPo();
		SaleReviewImg saleReviewImg = SpringHelper.getBean(SaleReviewImg.class);
		saleReviewImg.setData(po);
		return saleReviewImg;
	}

	public SaleReviewImg newInstance(SaleReviewImgPo po) {
		SaleReviewImg saleReviewImg = SpringHelper.getBean(SaleReviewImg.class);
		saleReviewImg.setData(po);
		return saleReviewImg;
	} 
	
	@Override
	protected IQueryDao<String, SaleReviewImgPo> getQueryDao() {
		return saleReviewImgQueryDao;
	}

	@Override
	public List<SaleReviewImgPo> findByReviewId(String reviewId) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("reviewId", reviewId);
		return saleReviewImgQueryDao.findByKey("findByReviewId", params);
		
	}

	
}
